package com.bfly.mall.order.enums;

/**
 * 订单操作类型枚举
 *
 * @author 长沙商脉科技有限公司
 * @date 2020/4/19 21:11
 */
public enum OrderOpTypeEnum {
    BOOKING_MEMBER(101, "预下单"),
    PAY_MEMBER(102, "订单支付"),
    CONFIRM_RECEIVE_MEMBER(103, "买家确认收货"),
    CANCEL_ORDER_MEMBER(104, "买家取消订单"),
    REQUEST_REFUND_MEMBER(105, "买家申请退款"),
    REQUEST_REFUND_PRODUCT_MEMBER(106, "买家申请退款退货"),

    CANCEL_ORDER_SHOPKEEPER(200, "商家取消订单"),
    SHIP_SHOPKEEPER(201, "商家发货"),
    REQUEST_REFUND_CONFIRM_SHOPKEEPER(202, "商家同意退款"),
    REQUEST_REFUND_REJECT_SHOPKEEPER(203, "商家驳回退款"),
    CONFIRM_RECEIVE_SHOPKEEPER(204, "商家确认收货"),
    REFUND_SHOPKEEPER(205, "商家退款"),
    REFUND_COMPLETE(206,"退款完成"),

    CLOSED_SYSTEM(301, "订单关闭"),
    RECEIVE_TIMEOUT_SYSTEM(302, "收货超时"),
    PAY_TIMEOUT_SYSTEM(303, "支付超时");


    private int id;
    private String name;

    OrderOpTypeEnum(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public static OrderOpTypeEnum getType(int id) {
        for (OrderOpTypeEnum status : OrderOpTypeEnum.values()) {
            if (id == status.getId()) {
                return status;
            }
        }
        return null;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
